<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="text" id="i1">
<input type="button" value="添加帅哥" onclick="f1()">
<input type="button" value="添加美女" onclick="f2()">
<script>
    function f1() {
        let num = document.querySelector("#i1");
        for (i=0;i<num.value;i++) {
            let i1 = document.createElement("img");
            i1.src = "../Desert.jpg";
            document.body.append(i1);
        }
    }
    function f2() {
        let num = document.querySelector("#i1");
        for (i=0;i<num.value;i++) {
            let i1 = document.createElement("img");
            i1.src = "../Desert.jpg";
            document.body.append(i1);
        }
    }
</script>
</body>
</html>